cmake_minimum_required(VERSION 3.6)  
project(DragonBonesCPP)

# 添加头文件搜索路径
include_directories(${CMAKE_CURRENT_LIST_DIR}/)
include_directories(${CMAKE_CURRENT_LIST_DIR}/3rdParty/)
include_directories(${CMAKE_CURRENT_LIST_DIR}/DragonBones/src/)
include_directories(${CMAKE_CURRENT_LIST_DIR}/DragonBones/src/dragonBones/core/)
include_directories(${CMAKE_CURRENT_LIST_DIR}/DragonBones/src/dragonBones/parsers/)

# 获取当前目录下要编译的源文件  
file(GLOB_RECURSE SRC_FILES 
	${CMAKE_CURRENT_LIST_DIR}/DragonBones/src/dragonBones/*.cpp)

# 添加要编译的源文件  
if(BUILD_SHARED_LIBS)
	add_library(DragonBones SHARED ${SRC_FILES})
else()
	add_library(DragonBones STATIC ${SRC_FILES})
endif()


include_directories(./DragonBones/src/dragonBones/model/) 
# add_executable(DragonBones_test DragonBones_test.cpp)
# target_link_libraries(DragonBones_test PRIVATE DragonBones) 

# 获取当前目录下的所有 .h 文件  
# file(GLOB_RECURSE HEADER_FILES 
# 	./DragonBones/src/dragonBones/*.h)
# message(error ${HEADER_FILES})

# 安装库文件  
# install(TARGETS DragonBones DESTINATION ${CMAKE_INSTALL_PREFIX}/lib)
file(COPY ${CMAKE_CURRENT_LIST_DIR}/DragonBones/src/dragonBones/ DESTINATION ${CMAKE_INSTALL_PREFIX}/include)
file(COPY ${CMAKE_CURRENT_LIST_DIR}/3rdParty/ DESTINATION ${CMAKE_INSTALL_PREFIX}/include)
file(GLOB_RECURSE DEL_FILES
	${CMAKE_INSTALL_PREFIX}/include/*.cpp)
file(REMOVE ${DEL_FILES})
install(TARGETS DragonBones DESTINATION ${CMAKE_INSTALL_PREFIX}/lib)  